#include "Interpolation.h"

using namespace std;

int main()
{
    vector<double> X, Y, T, D, S;
    T = {0, 3, 5, 8, 13};
    D = {0, 225, 383, 623, 993};
    S = {75, 77, 80, 74, 72};
    int n = 5;
    Y.resize(2*n);
    X.resize(2*n);

    for (int i = 0; i < T.size(); i++)
    {
	X[2*i] = T[i];
	X[2*i+1] = T[i];
	
	Y[2*i] = D[i];
	Y[2*i+1] = S[i];
    }
    
    cout << "X = " << "";
    for (int i = 0; i < X.size(); i++)
    {
	cout << X[i] << " ";
    }
    cout << endl;

    cout << "Y = " << "";
    for (int i = 0; i < Y.size(); i++)
    {
	cout << Y[i] << " ";
    }
    cout << endl;
    
    Newton NI(X,Y);
    NI.printF();

    cout << "t = 10, Speed = " << NI.diff(10) << endl;
    for (int i = 0; i <= 50; i++)
    {
	cout << "-" << "";
    }
    cout << endl;
    
    return 0;
}
